package com.hualude.roadsign.repository;

import com.hualude.roadsign.dto.DTRequestDto;
import com.hualude.roadsign.dto.FeedbackDto;
import com.hualude.roadsign.dto.HomepageAboutDto;
import com.hualude.roadsign.model.FeedbackEntity;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by xu-jiaHui on 2017/4/10.
 */
public interface FeedbackRepository extends CrudRepository<FeedbackEntity, Long> {


    /**
     * @Description: 获取反馈信息用于DT展示
     * @Author: xu-jiaHui
     * @Date: 2017/4/28 14:36
     */
    public List<FeedbackDto> getFeedBack4Dt(DTRequestDto dtRequestDto) throws Exception;

    public Integer getFeedBackCount4Dt(String search) throws Exception;

    public List<HomepageAboutDto> getAboutInfo(Integer infoId) throws Exception;

    @Modifying
    @Query(value = "update HomepageAboutEntity set orgTele=?1,orgFax=?2,orgMail=?3,orgWebsite=?4")
    public Integer updataAboutInfo(String aboutTele, String aboutFax, String aboutMail, String aboutWebsite) throws Exception;

}
